package cn.dada.dadarecipes.mall.shop.controller;

import cn.dada.dadarecipes.base.response.JsonResult;
import cn.dada.dadarecipes.mall.shop.pojo.vo.ShopVO;
import cn.dada.dadarecipes.mall.shop.service.ShopService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@Api(tags = "03.02商铺信息")
@Slf4j
@RestController
@RequestMapping("/v1/shop/")
public class ShopController {

    @Autowired
    ShopService shopService;

    @ApiOperation(value ="商铺查询功能")
    @GetMapping("select/{shopId}")
    public JsonResult selectShop(@PathVariable Long shopId){
        log.debug("查询商铺：shopId={}",shopId);
        ShopVO shopVO = shopService.selectShop(shopId);
        return JsonResult.ok(shopVO);
    }
}
